---@class SkillEffect634100:BaseSkillEffect
SkillEffect634100 = ClientFight.CreateClass("SkillEffect634100",ClientFight.BaseSkillEffect)
local t = SkillEffect634100
t.SKILL_EFFECT_634100_STORE_DAMAGE = "SKILL_EFFECT_634100_STORE_DAMAGE"
---@param skill FightUsingSkill
---@param target Fighter
function t:calculateSkillHeal(skill,target)
    local fighter = skill.fighter
    local fight = fighter.fight
    local skillBean = skill.skill.skillBean
    local calculateAttrType = skillBean.f_TriggerFigthHurt
    local modifiedRatio = skillBean.f_HurtCorrectFactor ~= nil and skillBean.f_HurtCorrectFactor[1] or 10000;
    local bonus = skillBean.f_HurtBase ~= nil and skillBean.f_HurtBase[1] or 0;

    --fight.log("技能治疗计算：开始{calculateAttrType:{},modifiedRatio:{}},{}---vs---{}", calculateAttrType, modifiedRatio, fighter:printAttr(), target:printAttr());
    ---@type FightResult
    local result = FightResult.New();
    result:setState(DamageResultTypeEnum.HEAL);

    local atk = Formulas.calculateAtkAttr(fighter, target, calculateAttrType,true);
    --fight.log("技能治疗计算：攻击值{atk:{}}", atk);

    local cure = FighterAttributeManager.getFightAttr(fighter, FighterAttributeEnum.CURE:getId());
    local curePer = FighterAttributeManager.getFightAttr(fighter, FighterAttributeEnum.CURE_PER:getId());

    local heal = atk * cure * Utils.toRatio(curePer);
    --fight.log("技能治疗计算：治疗值{heal:{}}", heal);
    -- 比例修正
    if (modifiedRatio > 0) then
        heal = heal * Utils.toRatio(modifiedRatio);
        --fight.log("技能治疗计算：比例修正{heal:{},modifiedRatio:{}}", heal, modifiedRatio);
    end

    -- 额外修正
    if (bonus > 0) then
        heal = heal + bonus;
        --fight.log("技能治疗计算：额外修正{heal:{},bonus:{}}", heal, bonus);
    end
    local storeDamage =  fighter.parametersByObject[SkillEffect634100.SKILL_EFFECT_634100_STORE_DAMAGE] or 0.0
    fighter.parametersByObject[SkillEffect634100.SKILL_EFFECT_634100_STORE_DAMAGE] = nil
    heal = heal + storeDamage;
    --fight.log("技能治疗计算：存储的圣伤害转化为治疗值{heal:{}, 存储的圣伤害额外增加:{}}", heal, storeDamage);

    --治疗效果
    local cureEffect = FighterAttributeManager.getFightAttr(target, FighterAttributeEnum.CURE_EFFECT:getId());
    if (cureEffect < -10000) then
        cureEffect = -10000;
    end
    --fight.log("技能治疗计算：治疗效果{heal:{},cureEffect:{}}", heal, cureEffect);
    local cureEffectAdd = heal * cureEffect / 10000;
    heal = heal + cureEffectAdd;

    result:setDamage(math.floor( heal));
    return result;
end
t.New()